package org.example.hospital_frontend.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.hospital_frontend.domain.MedicalRecord;
import org.example.hospital_frontend.domain.MedicalRecordVO;
import org.example.hospital_frontend.service.MedicalRecordService;
import org.example.hospital_frontend.mapper.MedicalRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import java.util.Map;

/**
* @author Administrator
* @description 针对表【medical_record(患者病历表)】的数据库操作Service实现
* @createDate 2025-05-23 20:34:53
*/
@Service
public class MedicalRecordServiceImpl extends ServiceImpl<MedicalRecordMapper, MedicalRecord>
    implements MedicalRecordService{

    @Autowired
    private MedicalRecordMapper medicalRecordMapper;

    @Override
    public Page<MedicalRecordVO> getMedicalRecordVOPage(Page<MedicalRecordVO> page, String keyword) {
        return medicalRecordMapper.selectMedicalRecordVOPage(page, keyword);
    }

    @Override
    public MedicalRecordVO getMedicalRecordVOById(Integer id) {
        return medicalRecordMapper.selectMedicalRecordVOById(id);
    }

    @Override
    public List<MedicalRecord> selectAllMedicalRecords() {
        return medicalRecordMapper.selectAllMedicalRecords();
    }

    @Override
    public MedicalRecord selectMedicalRecordById(Long id) {
        return medicalRecordMapper.selectMedicalRecordById(id);
    }

    @Override
    public void deleteMedicalRecordById(Long id) {
        medicalRecordMapper.deleteMedicalRecordById(id);
    }

    @Override
    public List<Map<String, Object>> selectDoctorStatistics() {
        return medicalRecordMapper.selectDoctorStatistics();
    }

    @Override
    public List<Map<String, Object>> selectDiagnosisStatistics() {
        return medicalRecordMapper.selectDiagnosisStatistics();
    }
}




